//
//  KZMistakesCoachingSubjectTypeCell.m
//  lg_zhinengbeikao_english
//
//  Created by 朱凯 on 2018/12/20.
//  Copyright © 2018年 zhukai. All rights reserved.
//

#import "KZMistakesCoachingSubjectTypeCell.h"

@implementation KZMistakesCoachingSubjectTypeCell
{
    UIImageView *_iconView;     // 图标
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
        [self setupUI];
        
    }
    return self;
}
- (void)setupUI {
    
    _iconView = [UIImageView new];
    _iconView.backgroundColor = kRedColor;
    [self.contentView addSubview:_iconView];
    [_iconView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(W(15));
        make.width.mas_equalTo(W(35));
        make.height.mas_equalTo(self->_iconView.mas_width).multipliedBy(25.0/35.0);
        make.centerY.equalTo(self.contentView);
    }];
    
    _typeLabel = [UILabel new];
    _typeLabel.font = FONT(16);
    _typeLabel.textAlignment = NSTextAlignmentLeft;
    _typeLabel.textColor = [UIColor blackColor];
    [self.contentView addSubview:_typeLabel];
    [_typeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self->_iconView.mas_right).offset(W(15));
        make.centerY.equalTo(self.contentView);
    }];
    
    _countLabel = [UILabel new];
    _countLabel.font = FONT(14);
    _countLabel.text = @"10";
    _countLabel.textAlignment = NSTextAlignmentLeft;
    _countLabel.textColor = [UIColor lightGrayColor];
    [self.contentView addSubview:_countLabel];
    [_countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView);
        make.centerY.equalTo(self.contentView);
    }];
    
    UIView *line = [UIView new];
    line.backgroundColor = kLineColor;
    [self.contentView addSubview:line];
    [line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(W(10));
        make.right.equalTo(self).offset(-W(10));
        make.bottom.mas_equalTo(0);
        make.height.equalTo(@0.5);
    }];
}

@end
